﻿using System;
using System.Collections.Generic;
using Silent.MDB.Common.Data;

namespace Silent.MDB.Application.Core
{
    public class DataCache : IDataCache
    {
        private static readonly Lazy<DataCache> m_dataCache = new Lazy<DataCache>();

        public DataCache()
        {
            RootObjects = new List<RootObject>();
            Folders = new List<Folder>();
            Persons = new List<Person>();
            Teachers = new List<Teacher>();
            Students = new List<Student>();
            Departments = new List<Department>();
            Cathedras = new List<Cathedra>();
            Faculties = new LinkedList<Faculty>();
        }

        public ICollection<RootObject> RootObjects { get; private set; }
        public ICollection<Folder> Folders { get; private set; }
        public ICollection<Person> Persons { get; private set; }
        public ICollection<Teacher> Teachers { get; private set; }
        public ICollection<Student> Students { get; private set; }
        public ICollection<Department> Departments { get; private set; }
        public ICollection<Cathedra> Cathedras { get; private set; }
        public ICollection<Faculty> Faculties { get; private set; }

        public static IDataCache Instance
        {
            get { return m_dataCache.Value; }
        }

        public void SaveChanges()
        {
            throw new NotImplementedException();
        }
    }
}
